<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>合并排列数组</title>
	</head>
	<body>
		<script>
			//
			var arr1 = [2,5,8,11];
			var arr2 = [3, 6, 9, 12, 15];
			//
		    var newArr = [];
			for (var i = 0; i < arr1.length; i++) {
				newArr[i] = arr1[i];
			}
			for (var i = arr1.length,j = 0; j < arr2.length; j++,i++) {
				newArr[i] = arr2[j];
			}
			
			newArr.sort((a,b) => a-b)
			console.log(newArr);
		</script>
	</body>
</html>